package flextv.main.command {

import com.adobe.cairngorm.commands.ICommand;
import com.adobe.cairngorm.control.CairngormEvent;

import flextv.core.logic.Logger;
import flextv.core.vo.StoredItem;
import flextv.data.IPersistenceService;
import flextv.main.event.StoredItemDownloadedEvent;
import flextv.main.logic.MainServices;

import mx.logging.ILogger;

public class StoredItemDownloadedCommand implements ICommand {
	
	private static const LOG: ILogger = Logger.getLog(StoredItemDownloadedCommand);
	
	public function StoredItemDownloadedCommand() {
	}

	public function execute(_event: CairngormEvent): void {
		const event: StoredItemDownloadedEvent = _event as StoredItemDownloadedEvent;
		LOG.info("Executing [event=" + event + "].");
		
		
		const persistenceService: IPersistenceService = MainServices.instance.persistenceService;
		const storedItem: StoredItem = event.storedItem;
		
		persistenceService.updateStoredItem(storedItem);
	}
	
}
}